package com.cltech.controller.sys;


import com.cltech.entity.sys.SysUser;
import com.cltech.service.sys.SysUserService;
import com.cltech.util.PasswordUtil;
import com.cltech.frame.result.ResponseBean;
import com.cltech.frame.shiro.Token;
import com.cltech.frame.utils.JWTUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/12/8.
 */
@RestController
@RequestMapping("public/user")
@Api(tags = {"登录、注册、退出"})
public class LoginController {
    @Autowired
    private SysUserService sysUserService;
    @PostMapping("/login")
    @ApiOperation("登录")
    public Object login(@RequestParam("account") String account,
                              @RequestParam("password") String password) {
        return sysUserService.login(account, password);
    }
    @PostMapping("/refreshToken")
    @ApiOperation("刷新token")
    public Object refreshToken(@RequestParam("refreshToken") String refreshToken) {
        return sysUserService.refreshToken(refreshToken);
    }
}
